# -*- coding: utf-8 -*-

inputs=raw_input().lower()
letters = 'abcdefghijklmnopqrstuvwxyz'
md={}
for e in letters:
    md[e]=0
for e in inputs:
    if e in letters:
        md[e]+=1

maxletter, maxnum = ',',0
for letter, num in md.items():
    if num>maxnum:
        maxnum=num
        maxletter=letter

print maxletter+' '+str(maxnum)